﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using System.Reflection;

namespace Sparrow.IoC
{
    internal class TypeEnumerator:ITypeEnumerator
    {
       

        public IEnumerable<Type> GetTypes()
        {
            ICollection assemblies = System.Web.Compilation.BuildManager.GetReferencedAssemblies();
            foreach (Assembly assembly in assemblies)
            {
                foreach (var type in assembly.TryGetTypes())
                {
                   yield return type;                        
                }

            }
        }
    }
}
